<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    var html = "<!--我是注释节点--><div>节点</div>";
    var index = 0;
    //索引
    function advance(n) {
      index += n;
      html = html.substring(n);
      console.log(html);
    }

    console.log(html.length);
    advance(13);
  </script>
</html>
